package YAVMM::GuestManager;
use Moose;

use YAVMM::Error;

has 'settings' => (
    is        => 'rw',
    does      => 'YAVMM::Settings',
    required  => 1,
);

sub start_guest   { $_[0]->_not_supported; }
sub stop_guest    { $_[0]->_not_supported; }
sub migrate_guest { $_[0]->_not_supported; }
sub kill_guest    { $_[0]->_not_supported; }
# returns hash { protocol, ip, port }
sub get_guest_console_info { $_[0]->not_supported; }

# takes a string representing the command line
# return YAVMM::Guest
sub parse_command_line { $_[0]->not_supported; }

# takes a command line and returns true if the command line
# is valid for the guest manager.
sub valid_command_line { $_[0]->not_supported; }

sub _not_supported {
    my $self = shift;

    my @caller = caller(1);

    die YAVMM::Error::Guest->new(
	error => "$caller[3] action is not supported by ".$self->_original_class_name
    );
}

with 'YAVMM::GuestManager::Role', 'MooseX::Object::Pluggable';

__PACKAGE__->meta->make_immutable;
1;

__END__

=head1 NAME

YAVMM::GuestManager - Role for managing guests.

=head1 SYNOPSIS

=head1 DESCRIPTION

=head1 MEMBERS

=head2 settings

Settings is an object that implements the 'YAVMM::Settings' role.

The settings object is required on creation.

=head1 ROLE METHODS

These methods must be implemented by specific manager classes.
